#include<stdio.h>
int main(){
	int n = 0;
	scanf("%d",&n);
	int i = 0;
	int max = 0;
	for(i = 1;i<=n;i++){
		int h = 0;
		scanf("%d",&h);
		if(max<h){
			max = h;
		}
	}
	printf("%d",max);
	return 0;
}
